import { defineStore } from 'pinia'
// export const userCountStore = defineStore('count', {
//     actions: {
//         increment(value: number) {
//             this.sum += value
//         }
//     },
//     state: () => ({
//         sum: 0
//     }),
//     getters: {
//         doubleAll: state => state.sum * 2
//     },

// })
import { ref, computed } from 'vue'
export const userCountStore = defineStore('count', () => {
    let sum = ref(2)
    const doubleAll = computed(() => sum.value * 2)
    function increment(value: number) {
        sum.value += value
    }
    return { sum, doubleAll, increment }
})